<template>
  <div class="types-container">
    <div class="type" :class="{ active: curruentChoose }" @click="selectInput">
      收入
    </div>
    <div
      class="type"
      :class="{ active: !curruentChoose }"
      @click="selectOutput"
    >
      支出
    </div>
  </div>
</template>

<script setup lang="ts">
import { Ref, ref } from "vue";
import { useTagLists } from "./../../store";

let store = useTagLists();
const curruentChoose: Ref<boolean> = ref(true);
const selectInput = (): void => {
  curruentChoose.value = true;
  console.log(curruentChoose.value);
  store.Type = curruentChoose.value;
};
const selectOutput = (): void => {
  curruentChoose.value = false;
  console.log(curruentChoose.value);
  store.Type = curruentChoose.value;
};
</script>

<style scoped lang="less">
.types-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  // padding: 0px 5px;
  height: 7vh;
  .type {
    &:nth-child(1) {
      border-radius: 35px 0px 0px 0px;
    }
    &:nth-child(2) {
      border-radius: 0px 35px 0px 0px;
    }
    background-color: rgb(224, 228, 230);
    // border-radius: 20px;

    font-size: 24px;
    line-height: 7vh;
    font-weight: 520;
    // margin: 0px 5px;
    width: 50%;
    text-align: center;
  }
  .active {
    background-color: rgb(122, 144, 156);
    color: white;
    border-bottom: 6px solid black;
  }
}
</style>
